﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;

namespace MulagoDb.database
{
   public class ScdDiagnosis
    {
       public ScdDiagnosis() { 
       //
       }
       public static void insertDiagnosis(int pid,string classification,string ageFirstsymptom,
           string firstSymptom,string reason,string history,string screeningProg,string labMethod){
               MySqlConnection connection = new MySqlConnection(PatientRegistration.myConString);
               connection.Open();
               MySqlCommand command = connection.CreateCommand();
               string query = "INSERT INTO scd_diagnosis VALUES('',"+pid+",'"+
                   classification+"','"+ageFirstsymptom+"','"+firstSymptom+"','"+reason+"','"+
                   history+"','"+screeningProg+"','"+labMethod+"')";
               command.CommandText = query;
               MySqlDataReader reader = command.ExecuteReader();
               connection.Close();
       }

       public static void insertScdOtherlabtests(int pid,string test,string date,string result) {
           MySqlConnection connection = new MySqlConnection(PatientRegistration.myConString);
           connection.Open();
           MySqlCommand command = connection.CreateCommand();
           string query = "INSERT INTO scd_otherlabtests VALUES(" + pid + ",'" +
               test + "','" +date + "','" + result+ "')";
           command.CommandText = query;
           MySqlDataReader reader = command.ExecuteReader();
           connection.Close();
       }

       public static void insertScd_g6pd(int pid, string test, string date, string result) {
           MySqlConnection connection = new MySqlConnection(PatientRegistration.myConString);
           connection.Open();
           MySqlCommand command = connection.CreateCommand();
           string query = "INSERT INTO scd_g6pd VALUES(" + pid + ",'" +
               test + "','" + date + "','" + result + "')";
           command.CommandText = query;
           MySqlDataReader reader = command.ExecuteReader();
           connection.Close();
       }
    }
}
